﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FlashSolution
{
    /// <summary>
    /// This class is used to set all the Flash-attributes for the SWFObject
    /// </summary>
    public class FlashAttributes 
    {       

        #region Flash Attribute Enums
        /// <summary>
        /// Quality of movie playback
        /// </summary>
        public enum enumQuality
        {
            /// <summary>
            /// use client default quality setting
            /// </summary>
            [StringValue(null)]
            Default,

            /// <summary>
            /// favors playback speed over appearance and never uses anti-aliasing. 
            /// </summary>
            [StringValue("Low")]
            Low,

            /// <summary>
            /// emphasizes speed at first but improves appearance whenever possible. Playback begins with anti-aliasing turned off. If the Flash Player detects that the processor can handle it, anti-aliasing is turned on. 
            /// </summary>
            [StringValue("AutoLow")]
            Autolow,

            /// <summary>
            /// emphasizes playback speed and appearance equally at first but sacrifices appearance for playback speed if necessary. Playback begins with anti-aliasing turned on. If the actual frame rate drops below the specified frame rate, anti-aliasing is turned off to improve playback speed. Use this setting to emulate the View > Antialias setting in Flash. 
            /// </summary>
            [StringValue("AutoHigh")]
            Autohigh,

            /// <summary>
            /// applies some anti-aliasing and does not smooth bitmaps. It produces a better quality than the Low setting, but lower quality than the High setting. 
            /// </summary>
            [StringValue("Medium")]
            Medium,

            /// <summary>
            /// favors appearance over playback speed and always applies anti-aliasing. If the movie does not contain animation, bitmaps are smoothed; if the movie has animation, bitmaps are not smoothed. 
            /// </summary>
            [StringValue("High")]
            High,

            /// <summary>
            /// the best display quality and does not consider playback speed. All output is anti-aliased and all bitmaps are smoothed. 
            /// </summary>
            [StringValue("Best")]
            Best
        }

        /// <summary>
        /// Scale enumerator
        /// </summary>
        public enum enumScale
        {
            /// <summary>
            /// use client default scale setting
            /// </summary>
            [StringValue(null)]
            Default,

            /// <summary>
            /// makes the entire movie visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders may appear on two sides of the movie. 
            /// </summary>
            [StringValue("ShowAll")]
            ShowAll,

            /// <summary>
            /// scales the movie to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the movie. 
            /// </summary>
            [StringValue("NoBorder")]
            NoBorder,

            /// <summary>
            /// makes the entire movie visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur. 
            /// </summary>
            [StringValue("ExactFit")]
            ExactFit,

            [StringValue("noscale")]
            NoScale
        }

        /// <summary>
        /// alignment enumerator
        /// </summary>
        public enum enumAlign
        {
            /// <summary>
            /// centers the movie in the browser window and crops edges if the browser window is smaller than the movie. 
            /// </summary>
            [StringValue(null)]
            Default,

            /// <summary>
            /// align the movie along the Left edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("left")]
            Left,

            /// <summary>
            /// align the movie along the Top edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("top")]
            Top,

            /// <summary>
            /// align the movie along the Right edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("right")]
            Right,

            /// <summary>
            /// align the movie along the Bottom edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("bottom")]
            Bottom,

            /// <summary>
            /// align the movie along the Bottom edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("middle")]
            Middle
        }

        /// <summary>
        /// alignment enumerator
        /// </summary>
        public enum enumSAlign
        {
            /// <summary>
            /// use client default alignment
            /// </summary>
            [StringValue(null)]
            Default,

            /// <summary>
            /// align the movie along the Left edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("L")]
            Left,

            /// <summary>
            /// align the movie along the Top edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("T")]
            Top,

            /// <summary>
            /// align the movie along the Right edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("R")]
            Right,

            /// <summary>
            /// align the movie along the Bottom edge of the browser window and crop the remaining three sides as needed. 
            /// </summary>
            [StringValue("B")]
            Bottom,

            /// <summary>
            /// align the movie to the Top Left corner of the browser window and crop the bottom and remaining right side as needed. 
            /// </summary>
            [StringValue("TL")]
            TopLeft,

            /// <summary>
            /// align the movie to the Top Right corner of the browser window and crop the bottom and remaining left side as needed. 
            /// </summary>
            [StringValue("TR")]
            TopRight,

            /// <summary>
            /// align the movie to the Bottom Right corner of the browser window and crop the top and remaining right side as needed. 
            /// </summary>
            [StringValue("BL")]
            BottomLeft,

            /// <summary>
            /// align the movie to the Bottom Right corner of the browser window and crop the top and remaining left side as needed. 
            /// </summary>
            [StringValue("BR")]
            BottomRight
        }

        /// <summary>
        /// Boolean enumerator
        /// </summary>
        public enum enumBoolean
        {
            [StringValue(null)]
            Default,

            [StringValue("True")]
            True,

            [StringValue("False")]
            False,
        }

        /// <summary>
        /// The WindowMode enumerator 
        /// </summary>
        public enum enumWMode
        {
            /// <summary>
            /// use clients default setting
            /// </summary>
            [StringValue(null)]
            Default,

            /// <summary>
            /// movie plays in its own rectangular window on a web page
            /// </summary>
            [StringValue("Window")]
            Window,

            /// <summary>
            /// the movie hides everything on the page behind it
            /// </summary>
            [StringValue("Opaque")]
            Opaque,

            /// <summary>
            /// the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance.
            /// </summary>
            [StringValue("Transparent")]
            Transparent
        }

        /// <summary>
        /// Enumerator which sets if ScriptAccess is allowed from within the flashobject
        /// </summary>
        public enum enumAllowScriptAccess
        {
            [StringValue(null)]
            Default,
            [StringValue("sameDomain")]
            SameDomain,
            [StringValue("Never")]
            Never,
            [StringValue("Always")]
            Always
        }

        /// <summary>
        /// Enumerator which sets if NetworkAccess is allowed from within the flashobject
        /// </summary>
        public enum enumNetworking
        {
            [StringValue(null)]
            Default,
            [StringValue("all")]
            All,
            [StringValue("internal")]
            Internal,
            [StringValue("none")]
            None
        }

        #endregion

        #region Flash Attributes Public Fields
        /// <summary>
        /// Width of the movie
        /// </summary>
        public string width ;

        /// <summary>
        /// Height of the movie
        /// </summary>
        public string height ;

        /// <summary>
        /// Required FlashPlayer version. Default "6"
        /// </summary>
        public string version = "6.0.29.0";

        /// <summary>
        /// URL of the movie
        /// </summary>
        public string movie = null;

        /// <summary>
        /// Identifies the Flash movie to the host environment (a web browser, for example) so that it can be referenced using a scripting language. OBJECT-specific. 
        /// </summary>
        public string id = null;

        /// <summary>
        /// Identifies the Flash movie to the host environment (a web browser, typically) so that it can be referenced using a scripting language such as JavaScript or VBScript. EMBED-specific. 
        /// </summary>
        public string name = null;

        /// <summary>
        /// Specifies whether the browser should start Java when loading the Flash Player for the first time. The default value is false if this attribute is omitted. If you use JavaScript and Flash on the same page, Java must be running for the FSCommand to work. 
        /// </summary>
        public enumBoolean swliveconnect = enumBoolean.Default;

        /// <summary>
        /// Specifies whether the movie begins playing immediately on loading in the browser. The default value is true if this attribute is omitted. 
        /// </summary>
        public enumBoolean play = enumBoolean.Default;

        /// <summary>
        /// Specifies whether the movie repeats indefinitely or stops when it reaches the last frame. The default value is true if this attribute is omitted. 
        /// </summary>
        public enumBoolean loop = enumBoolean.Default;

        /// <summary>
        /// Setting to choose wether to displays the full menu, allowing the user a variety of options to enhance or control playback. Default is false.
        /// </summary>
        public enumBoolean menu = enumBoolean.Default;

        /// <summary>
        /// Playback quality of the movie
        /// </summary>
        public enumQuality quality = enumQuality.Default;

        /// <summary>
        /// Scaling of the movie
        /// </summary>
        public enumScale scale = enumScale.Default;

        /// <summary>
        /// Alignment of the movie
        /// </summary>
        public enumAlign align = enumAlign.Default;

        /// <summary>
        /// Alignment of the movie
        /// </summary>
        public enumSAlign salign = enumSAlign.Default;

        /// <summary>
        /// WindowMode setting
        /// </summary>
        public enumWMode wmode = enumWMode.Default;

        /// <summary>
        /// Background color setting. #FFFFFF or ffffff
        /// </summary>
        public string bgcolor = null;

        /// <summary>
        /// sets the base directlory or URL to use to resolve relative paths
        /// </summary>
        public string basepath = null;

        /// <summary>
        /// FlashVars collection
        /// </summary>
        public Dictionary<string,string> flashvars = new Dictionary<string,string>();

        /// <summary>
        /// use a device font for a static text field.
        /// </summary>
        public enumBoolean devicefont = enumBoolean.Default;

        /// <summary>
        /// The AllowScriptAccess parameter of the Macromedia Flash Player controls the ability to perform outbound scripting from within a Flash SWF.
        /// </summary>
        public enumAllowScriptAccess allowscriptaccess = enumAllowScriptAccess.Default;

        public enumBoolean seamlesstabbing = enumBoolean.Default;

        public enumBoolean allowfullscreen = enumBoolean.Default;

        public enumNetworking allownetworking = enumNetworking.Default;

        /// <summary>
        /// Extra params to specify height in percentage (i.e. 100%)
        /// </summary>
        public string sHeight = null;

        /// <summary>
        /// Extra params to specify width in percentage (i.e. 100%)
        /// </summary>
        public string sWidth = null;
        #endregion

    }

}
